Skip to content

fix(sdk): carry API key on execd requests per use_server_proxy declaration - #1687

Merged
Pangjiping merged 2 commits into
opensandbox-group:mainfrom
jiawen7777:fix/sdk-execd-proxy-api-key
Sep 4, 2026
Merged

fix(sdk): carry API key on execd requests per use_server_proxy declaration#1687
Pangjiping merged 2 commits into
opensandbox-group:mainfrom
jiawen7777:fix/sdk-execd-proxy-api-key

Conversation

@jiawen7777

Copy link
Copy Markdown
Contributor

Summary

Testing

  • Not run (explain why)
  • Unit tests
  • Integration tests
  • e2e / manual verification

6 new tests in tests/test_execd_proxy_auth_headers.py lock: declared proxy → key attached regardless of endpoint URL shape; direct mode → key never attached; no key configured → header omitted (async + sync). Full SDK suite, ruff check, and pyright all pass.

e2e: verified against a multi-tenant deployment — without the fix connect() fails after 30s with SandboxReadyTimeoutException while the server logs 401 MISSING_API_KEY on the proxy health route; with the fix connect() succeeds in <1s and commands/files work with no workaround.

Breaking Changes

  • None
  • Yes (describe impact and migration path)

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (if needed) — behavior now matches documented semantics, no docs change needed
  • Added/updated tests (if needed)
  • Security impact considered — direct mode test-locked to never attach the key
  • Backward compatibility considered — header only added when use_server_proxy=True; single-tenant deployments unaffected (server already exempts proxy paths per fix(server): skip auth for proxy-to-sandbox paths; strict path matching #250)

…ation

Multi-tenant servers authenticate the proxy route too, but execd adapters
sent no API key — Sandbox.connect() surfaced the 401 as a 30s timeout.
Attach the key only when the client declared proxy mode; in direct mode
it must never travel into the untrusted sandbox.

Fixes opensandbox-group#1686
@github-actions github-actions Bot added sdk/python size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 31, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 824254411d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread sdks/sandbox/python/src/opensandbox/models/sandboxes.py

@Pangjiping Pangjiping left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Pangjiping
Pangjiping merged commit a8ad18f into opensandbox-group:main Sep 4, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk/python size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-tenant servers: execd-plane requests omit OPEN-SANDBOX-API-KEY when use_server_proxy=True, surfacing as a 30s health-check timeout

2 participants